package com.cheetah.id.rest;

import com.cheetah.builder.Result;
import com.cheetah.builder.ResultBuilder;
import com.cheetah.id.generator.Generator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Administrator
 * @Date 2020/7/2
 * @Version V1.0
 * @Description:
 **/

@RestController
@RequestMapping("/id")
public class IDGeneratorRest {

    @Autowired
    private Generator generator;

    @RequestMapping("/generator/{workId}/{step}")
    public Long getId(@PathVariable String workId,@PathVariable long step){
        return generator.nextId(workId,step);
    }

}
